package com.dgut.springsecurity.Details;

import com.dgut.usermanager.entity.UserAccount;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;

public class UserAccountDetail extends User {

    private String power;

    public UserAccountDetail(UserAccount userAccount, Collection<? extends GrantedAuthority> authorities){
        super(userAccount.getAccount(),userAccount.getPassword(),authorities);
        this.power=userAccount.getPower();
    }
    public UserAccountDetail(UserAccount userAccount, boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, Collection<? extends GrantedAuthority> authorities){
        super(userAccount.getAccount(),userAccount.getPassword(),enabled,accountNonExpired,credentialsNonExpired,accountNonLocked,authorities);
        this.power=userAccount.getPower();
    }


    public String getPower() {
        return power;
    }

    public void setPower(String power) {
        this.power = power;
    }


}
